@echo off

rem 检查sqlite3.exe是否存在
if not exist "%~dp0\sqlite3.exe" (
    echo 未找到sqlite3.exe，请下载并放置在项目目录下。
    echo 或者尝试直接运行下面的命令（如果系统已安装sqlite3）：
    echo sqlite3 jntujy.db "SELECT COUNT(*) FROM notice_table; SELECT COUNT(*) FROM target_table; SELECT COUNT(*) FROM goods_table;"
    echo sqlite3 jntujy11.db "SELECT COUNT(*) FROM notice_table; SELECT COUNT(*) FROM target_table; SELECT COUNT(*) FROM goods_table;"
    pause
    exit /b 1
)

rem 查询jntujy.db
 echo 查询jntujy.db记录数：
 echo ===================
 sqlite3.exe jntujy.db "SELECT 'notice_table:' || COUNT(*) FROM notice_table; SELECT 'target_table:' || COUNT(*) FROM target_table; SELECT 'goods_table:' || COUNT(*) FROM goods_table; SELECT 'Total:' || (SELECT COUNT(*) FROM notice_table) + (SELECT COUNT(*) FROM target_table) + (SELECT COUNT(*) FROM goods_table);"
 echo.

rem 查询jntujy11.db
 echo 查询jntujy11.db记录数：
 echo ====================
 sqlite3.exe jntujy11.db "SELECT 'notice_table:' || COUNT(*) FROM notice_table; SELECT 'target_table:' || COUNT(*) FROM target_table; SELECT 'goods_table:' || COUNT(*) FROM goods_table; SELECT 'Total:' || (SELECT COUNT(*) FROM notice_table) + (SELECT COUNT(*) FROM target_table) + (SELECT COUNT(*) FROM goods_table);"

pause